package com.cc.shriojwtredis.wanling.service.serviceImpl;
import com.cc.shriojwtredis.wanling.domain.User;
import com.cc.shriojwtredis.wanling.mapper.UserMapper;
import com.cc.shriojwtredis.wanling.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    @Override
    public User checkLogin(String account,String password) {
        return userMapper.getUserByAccountAndPassword(account,password);
    }



    @Override
    public int getRoleByAccount(String account) {
        return userMapper.getRoleByAccount(account).getRole();
    }

    @Override
    public int addUser(User user) {
        return userMapper.insertUser(user);
    }

    @Override
    public User getUserByAccount(String account) {
        return userMapper.getUserByAccount(account);
    }

}
